<div class="tile tile-muted text-dark p-3">
    <h3><strong><%= @model.name %></strong> {</h3>
      <%= for {key, details} <- @model.fields do %>
        <dl class="row">
          <dt class="col-md-3">
            <%= key %>
          </dt>
          <dd class="col-md-9">
            <span>
              <%= if details[:type] != "model", do: details.type %>
              <%= if details[:definition] do %>
                <i class="fa-solid fa-circle-info ml-2"
                   data-toggle="tooltip"
                   data-placement="right"
                   data-html="true"
                   title="<%= model_type_definition(details.definition) %>"></i>
              <% end %>
            </span>
            <%= if details[:type] == "model" do %>
              <span>
                <strong><%= details.model.name %></strong>
              </span>
            <% end %>
            <%= if details[:type] == "array" do %>
              <div>
                [<strong><%= details.array_type.name %></strong>]
              </div>
            <% end %>
            <%= if details[:enum] do %>
              <div>enum: <%= details.enum %></div>
              <dl class="row mt-2">
                <dt class="col-md-2"> <strong>enum</strong></th>
                <dt class="col-md-10"><strong>interpretation</strong></th>
              </dl>
              <%= for {enum, interpretation} <- details[:enum_interpretation] do %>
                <dl class="row">
                  <dd class="col-md-2">
                    "<%= enum %>"
                  </dd>
                  <dd class="col-md-10">
                    <%= interpretation %>
                  </dd>
                </dl>
              <% end %>
            <% end %>
            <%= if details[:example] do %>
              <div>example: <%= details.example %></div>
            <% end %>
            <%= if details[:description] do %>
              <div> description: <%= details.description %></div>
            <% end %>
          </dd>

        </dl>
      <% end %>
      <h3>}</h3>
    </div> <!-- /table-responsive -->

<%= if @model.fields[:result][:type] == "array" do %>
  <%= render "_model_table.html", model: @model.fields[:result].array_type %>
<% end %>

<%= if @model.fields[:result][:type] == "model" do %>
  <%= render "_model_table.html", model: @model.fields[:result].model %>
<% end %>
